import {lazy} from 'react'
import {createBrowserRouter, Navigate} from 'react-router-dom'
import App from '../App'
const HomeView = lazy(()=>import('../views/HomeView'))
const CateView = lazy(()=>import('../views/CateView'))
const CartView = lazy(()=>import('../views/CartView'))
const PersonalView = lazy(()=>import('../views/PersonalView'))



const router = createBrowserRouter([
  {
    path: '/',
    element: <App></App>,
    children:[
        {
            path: '/Home',
            element: <HomeView></HomeView>
        },
        {
            path: '/cate',
            element: <CateView></CateView>
        },
        {
            path:'/cart',
            element: <CartView></CartView>
        },
        {
            path:'/personal',
            element: <PersonalView></PersonalView>
        },
        {
            path:'/',
            element: <Navigate to='/Home'></Navigate>
        }
    ]
  },
])


export default router